﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 聚欣订单分析.Master
{
    public partial class Site : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["qx"] != null)
            {
                if (Session["qx"].ToString() == "99")
                {
                    ztgl.Visible = true;//跟踪状态管理
                    projecttypemanage.Visible = true;
                    user.Visible = true;
                    eqType.Visible = true;
                    eqMoney.Visible = true;
                    ljh.Visible = true;
                    jhdj.Visible = true;
                    jhlx.Visible = true;
                    ysx.Visible = true;
                }
                if (Session["qx"].ToString() == "0")
                {
                    DataAdd.Visible = true;
                    kptj.Visible = true;
                    hktj.Visible = true;
                    DateZT.Visible = true;
                }
                if (Session["qx"].ToString() == "2")
                {
                    kpsh.Visible = true;
                    hksh.Visible = true;
                }
                if (Session["qx"].ToString() == "3")
                {
                    ljh.Visible = true;
                    lddfx.Visible = false;
                }
                if (Session["qtqx"] != null)
                {
                    if (Session["qtqx"].ToString().IndexOf("项目跟踪") >= 0)//跟踪状态
                        mxgz.Visible = true;
                    if (Session["qtqx"].ToString().IndexOf("客户管理") >= 0)
                        khxx.Visible = true;
                    if (Session["qtqx"].ToString().IndexOf("报价") >= 0)
                        zxbj.Visible = true;
                    if (Session["qtqx"].ToString().IndexOf("库管") >= 0)
                        jhdj.Visible = true;
                    if (Session["qtqx"].ToString().IndexOf("借货管理") >= 0)
                    {
                        jhdj.Visible = true;
                        jhlx.Visible = true;
                    }
                    if (Session["qtqx"].ToString().IndexOf("毛利管理") >= 0)
                        ddml.Visible = true;
                    if (Session["qtqx"].ToString().IndexOf("云视讯") >= 0)
                    {
                        ysx.Visible = true;
                        if (Session["qtqx"].ToString().IndexOf("成本") >= 0 && Session["qtqx"].ToString().IndexOf("回款审核") >= 0)
                        {
                            ysxdj.Visible = false;
                            ysxkptj.Visible = false;
                            ysxhktj.Visible = false;
                        }
                        else if (Session["qtqx"].ToString().IndexOf("录入") >= 0)
                        {
                            ysxcb.Visible = false;
                            ysxcbmx.Visible = false;
                            ysxhksh.Visible = false;
                            ysxkpsh.Visible = false;
                        }
                        else if (Session["qtqx"].ToString().IndexOf("成本") >= 0)
                        {
                            ysxdj.Visible = false;
                            ysxhktj.Visible = false;
                            ysxhksh.Visible = false;
                            ysxkptj.Visible = false;//开票提交
                            ysxkpsh.Visible = false;
                        }
                        else if (Session["qtqx"].ToString().IndexOf("回款审核") >= 0)
                        {
                            ysxcb.Visible = false;
                            ysxcbmx.Visible = false;
                            ysxdj.Visible = false;
                            ysxhktj.Visible = false;
                            ysxkptj.Visible = false;//开票提交
                        }
                        else
                        {
                            ysxcb.Visible = false;
                            ysxhksh.Visible = false;
                            ysxdj.Visible = false;
                            ysxhktj.Visible = false;
                            ysxkpsh.Visible = false;
                            ysxkptj.Visible = false;//开票提交
                        }
                    }
                }
            }
            else
            {
                try
                {
                    Response.Redirect("../login.aspx");
                }
                catch (Exception)
                {
                    //Response.Redirect("login.aspx");
                }
            }
        }
    }
}